package com.lp.mgt.mappers;



import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.lp.mgt.commons.annotation.DataPermission;
import com.lp.mgt.entities.User;

@Mapper
public interface UserMapper {

	public User findUserById(String id);
	public User findUserByName(String name);
	public Integer saveUserWhenRegister(User user);
	
	public Integer checkUserAndEmail(@Param("username") String userName, @Param("email") String email);
	public Integer getUserByNameWhenRegisterOrLogin(String username);
	public Integer updateUserWithUsername(User user);
	
	public Integer getUserCountWithTerms(User user);
	
	@DataPermission()
	public List<User> getUserDataWithTerms(User user);
	
	public String getOtherUserInfoById(String uid);
	public int removeUserSingleOrBatch(HashMap<String,Object> map);
	public List<User> getUserWithoutRole(@Param("roleId") String roleId,@Param("username") String username);
	public List<User> getUserWithRole(String roleId);
	public Integer deleteUserWithRoleIdAndUserId(HashMap<String, String> map);
	public void effectiveOrinvalid(HashMap<String, Object> map);
	public int saveFocusUser(@Param("currId") String currId,@Param("id") String id);
	public int removeFocusUser(@Param("currId") String currId,@Param("id") String id);
	public void removeUserAndRole(HashMap<String, Object> map);
	public void removeUserAndFocus(HashMap<String, Object> map);
	public void removeUserAndPost(HashMap<String, Object> map);
	public void saveUserWithPost(Map<String, Object> data);
	
	public void removeUserByDeptId(String deptId);
	//mgt_user_role
	public Integer addUserWithRole(HashMap<String, String> mapa);
	public void saveRoleWhenRegisterUser(@Param("uid") String uid,@Param("rid") String rid);
}
